//
//  THActionSheetConfig.m
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//
#import "THActionSheetConfig.h"
#define kLCActionSheetButtonHeight              50.0f

#define kLCActionSheetRedColor                  kLCActionSheetColor(254, 67, 37)

#define kLCActionSheetTitleFont                 [UIFont fontWithName:FONT_REGULAR size:12]

#define kLCActionSheetButtonFont                [UIFont fontWithName:FONT_REGULAR size:16]

#define kLCActionSheetAnimationDuration         0.3f

#define kLCActionSheetDarkOpacity               0.3f

#define kLCActionSheetBlurBgColorNormal         [[UIColor whiteColor] colorWithAlphaComponent:0.5]

#define kLCActionSheetColor(r, g, b)        kLCActionSheetColorA(r, g, b, 1.0f)

#define kLCActionSheetColorA(r, g, b, a)    [UIColor colorWithRed:(r)/255.0f\
                                                             green:(g)/255.0f\
                                                              blue:(b)/255.0f\
                                                                      alpha:a]
@implementation THActionSheetConfig

+ (THActionSheetConfig *)config {
    static id _config = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _config = [[self alloc] initSharedInstance];
    });
    return _config;
}

+ (instancetype)shared {
    return self.config;
}

- (instancetype)initSharedInstance {
    if (self = [super init]) {
        self.titleFont                = kLCActionSheetTitleFont;
        self.buttonFont               = kLCActionSheetButtonFont;
        self.destructiveButtonColor   = kLCActionSheetRedColor;
        self.titleColor               = Color_text_99;
        self.buttonColor              = Color_text_33;
        
        self.buttonHeight             = kLCActionSheetButtonHeight;
        self.animationDuration        = kLCActionSheetAnimationDuration;
        self.darkOpacity              = kLCActionSheetDarkOpacity;
        
        self.titleEdgeInsets          = UIEdgeInsetsMake(15.0f, 15.0f, 15.0f, 15.0f);
        self.buttonEdgeInsets         = UIEdgeInsetsMake(8.0, 15.0, 8.0, 15.0);
        self.divisionViewBGColor      = ColorFromHex(0xededed);
        self.separatorColor           = ColorFromHex(0xededed);
        self.blurBackgroundColor      = [UIColor whiteColor];
        self.buttonBghighlightColor   = ColorFromHex(0xe5e5e5);
        self.cancelButtonColor        = self.buttonColor;
        self.cancelButtonBgColor      = [UIColor clearColor];
        self.buttonBgColor            = [UIColor clearColor];
        self.destructiveButtonBgColor = [UIColor clearColor];
        self.buttonCornerRadius       = 0.0f;
    }
    return self;
}
- (instancetype)init {
    return THActionSheetConfig.config;
}
- (NSInteger)cancelButtonIndex {
    return 0;
}


@end
